﻿/*
 Copyright (c) 2009 Alvin Cho (alvincho@risklib.com)
 Copyright (c) 2009 RiskLib.com
 
 This file is part of RiskLib.NET Project. See http://www.risklib.net for more information.
 
 RiskLib.NET is an open source project. Using of RiskLib.NET is free of charge.
 It is distributed under GNU General Public License version 2 (GPLv2).
 GPLv2 can be found at http://www.risklib.net/risklib/license.
 
 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RiskLib
{
    //public class StatementCollection : Dictionary<string, Statement>
    //{
    //    public double GetFieldValue(DateTime date, StatementPeriodType type, FieldNameEnum fieldName)
    //    {
    //        string key = date.ToShortDateString() + type.ToString();
    //        return GetFieldValue(key, fieldName);
    //    }
    //    private double GetFieldValue(string reportKey, FieldNameEnum fieldName)
    //    {
    //        if (!this.ContainsKey(reportKey))
    //            throw new ArgumentOutOfRangeException("Statement " + reportKey + " is not available.");
    //        switch (fieldName)
    //        {
    //            default:
    //                Statement statement = this[reportKey];
    //                return statement.GetFieldValue(fieldName);
    //        }
    //    }
    //}
    public class Statement
    {
        public Statement(DateTime reportDate, StatementPeriodType type, string auditor, bool isConsolidated)
        {
        }
        public Statement(DateTime reportDate, StatementPeriodType type, string auditor, bool isConsolidated, double marketPrice)
            : this(reportDate, type, auditor, isConsolidated)
        {
            FieldValues.Add(FieldNameEnum.Price, marketPrice);
        }
        public DateTime ReportDate;
        public StatementPeriodType ReportType;
        public string Auditor;
        public bool IsConsolidated;
        protected Dictionary<FieldNameEnum, double> FieldValues = new Dictionary<FieldNameEnum, double>();

        public void SetFieldValue(FieldNameEnum fieldName, double v)
        {
            if (FieldValues.ContainsKey(fieldName))
                FieldValues[fieldName] = v;
            else
                FieldValues.Add(fieldName, v);
        }

        /// <summary>
        /// Get field value even if it is not been pre-set. If the value is not present, this method calculate, if possible, and set the field value to the statement.
        /// </summary>
        /// <param name="fieldName">Field name.</param>
        /// <returns>Return value if possible, exception otherwise.</returns>
        public double GetFieldValue(FieldNameEnum fieldName)
        {
            if (FieldValues.ContainsKey(fieldName))
                return FieldValues[fieldName];
            else
            {
                double v = 0;
                switch (fieldName)
                {
                    // Calculated Fields. These fields should be calculated from other fields.
                    case FieldNameEnum.CurrentRatio:
                        v = GetFieldValue(FieldNameEnum.CurrentAsset) / GetFieldValue(FieldNameEnum.CurrentLiability);
                        SetFieldValue(FieldNameEnum.CurrentRatio, v);
                        return v;
                    case FieldNameEnum.MarketCapital:
                    case FieldNameEnum.PriceEarningRatio:
                    case FieldNameEnum.PriceSalesRatio:
                    case FieldNameEnum.GrossMargin:
                    case FieldNameEnum.OperatingMargin:
                    case FieldNameEnum.PretaxMargin:
                    case FieldNameEnum.NetMargin:
                    case FieldNameEnum.QuickRatio:
                    case FieldNameEnum.TotalDebtToEquity:
                    case FieldNameEnum.InterestCoverage:
                    case FieldNameEnum.AverageDividendYield:
                    case FieldNameEnum.DividendPayOutPercent:
                    case FieldNameEnum.ReturnOnEquity:
                    case FieldNameEnum.ROA:
                    case FieldNameEnum.ReturnOnInvestment:
                    case FieldNameEnum.RevenuePerEmployee:
                    case FieldNameEnum.NetIncomePerEmployee:
                    case FieldNameEnum.ReceivableTurnover:
                    case FieldNameEnum.InventoryTurnover:
                    case FieldNameEnum.AssetTurnover:
                        throw new NotImplementedException(fieldName.ToString() + " not implemented yet");

                    // Additional Fields
                    case FieldNameEnum.Price:
                    case FieldNameEnum.EmployeeNumber:

                    // BalanceSheet Fields
                    case FieldNameEnum.TotalAsset:
                    case FieldNameEnum.CurrentAsset:
                    case FieldNameEnum.CashEquivalentShortTermInvestment:
                    case FieldNameEnum.CashEquivalent:
                    case FieldNameEnum.ShortTermInvestment:
                    case FieldNameEnum.Receivable:
                    case FieldNameEnum.ShortTermAssetRelatedParty:
                    case FieldNameEnum.CurrentTaxAsset:
                    case FieldNameEnum.ShortTermPrepayment:
                    case FieldNameEnum.ShortTermAssetForSale:
                    case FieldNameEnum.CurrentAssetDiscountinuedOperation:
                    case FieldNameEnum.Inventory:
                    case FieldNameEnum.RawMaterial:
                    case FieldNameEnum.WorkInProcess:
                    case FieldNameEnum.FinishedGoods:
                    case FieldNameEnum.Supplies:
                    case FieldNameEnum.OtherInventory:
                    case FieldNameEnum.OtherCurrentAsset:
                    case FieldNameEnum.LongTermAsset:
                    case FieldNameEnum.NetPropertyPlantEquipment:
                    case FieldNameEnum.GrossPropertyPlantEquipment:
                    case FieldNameEnum.AccumulatedDepreciation:
                    case FieldNameEnum.Land:
                    case FieldNameEnum.Building:
                    case FieldNameEnum.LongTermInvestment:
                    case FieldNameEnum.Intangible:
                    case FieldNameEnum.Goodwill:
                    case FieldNameEnum.IntangiblesExclueGoodWill:
                    case FieldNameEnum.LongTermPrepayment:
                    case FieldNameEnum.LongTermAssetRelatedParty:
                    case FieldNameEnum.LongTermAssetForSale:
                    case FieldNameEnum.LongTermReceivable:
                    case FieldNameEnum.DefferedLongTermAssetCharge:
                    case FieldNameEnum.NonCurrentAssetDiscountinuedOperation:
                    case FieldNameEnum.NetLoanLease:
                    case FieldNameEnum.Investment:
                    case FieldNameEnum.OtherLongTermAsset:
                    case FieldNameEnum.Cash:
                    case FieldNameEnum.FedFundResell:
                    case FieldNameEnum.AssetDiscountinuedOperation:
                    case FieldNameEnum.LoansForSale:
                    case FieldNameEnum.LoanPortfolio:
                    case FieldNameEnum.LoanProvisions:
                    case FieldNameEnum.DeferredPolicyAcqusitionCost:
                    case FieldNameEnum.OtherAsset:
                    case FieldNameEnum.Prepayment:
                    case FieldNameEnum.TotalAssetRelatedParty:
                    case FieldNameEnum.InsuranceReceivable:
                    case FieldNameEnum.AssetForSale:
                    case FieldNameEnum.Securities:
                    case FieldNameEnum.CustomerAcceptanceLiability:
                    case FieldNameEnum.TotalLiability:
                    case FieldNameEnum.CurrentLiability:
                    case FieldNameEnum.AccountPayableAccruedExpense:
                    case FieldNameEnum.AccountPayable:
                    case FieldNameEnum.AccuredExpense:
                    case FieldNameEnum.CurrentDebtCapitalLease:
                    case FieldNameEnum.CurrentDebt:
                    case FieldNameEnum.CurrentCapitalLeaseObligation:
                    case FieldNameEnum.ShortTermLiabilityRelatedParties:
                    case FieldNameEnum.CurrentLiabilityDiscountinuedOperation:
                    case FieldNameEnum.OtherCurrentLiability:
                    case FieldNameEnum.LongTermLiability:
                    case FieldNameEnum.LongTermObligations:
                    case FieldNameEnum.DeferredLongTermLiabilityCharge:
                    case FieldNameEnum.NonCurrentLiabilityDiscountinuedOperation:
                    case FieldNameEnum.PensionsOPEB:
                    case FieldNameEnum.CustomerAdvanceDeposit:
                    case FieldNameEnum.TotalDeposits:
                    case FieldNameEnum.OtherLongTermLiability:
                    case FieldNameEnum.TemporaryEquity:
                    case FieldNameEnum.BalanceSheetMinority:
                    case FieldNameEnum.ShareMandatoryRedemption:
                    case FieldNameEnum.TotalLiabilityEquity:
                    case FieldNameEnum.FedFundRepurchase:
                    case FieldNameEnum.LiabilityDiscountinuedOperation:
                    case FieldNameEnum.DepositInterestBearing:
                    case FieldNameEnum.DepositNonInterestBearing:
                    case FieldNameEnum.CurrentPortionLongTermDebt:
                    case FieldNameEnum.PolicyLiability:
                    case FieldNameEnum.OtherLiability:
                    case FieldNameEnum.LongTermLiabilityRelatedParty:
                    case FieldNameEnum.TotalLiabilityRelatedParty:
                    case FieldNameEnum.DebtLeaseOligation:
                    case FieldNameEnum.CapitalLeaseObligation:
                    case FieldNameEnum.InsurancePayable:
                    case FieldNameEnum.BankReceivable:
                    case FieldNameEnum.ShareholdersEquity:
                    case FieldNameEnum.CommonShareCapital:
                    case FieldNameEnum.PreferredShareCapital:
                    case FieldNameEnum.ShorePremium:
                    case FieldNameEnum.RetainedEarning:
                    case FieldNameEnum.AccumulatedOtherIncome:
                    case FieldNameEnum.OtherEquity:
                    case FieldNameEnum.TreasuryStock:
                    case FieldNameEnum.ForeignCurrencyTransation:
                    case FieldNameEnum.NetAssets:
                    case FieldNameEnum.NetCurrentAssets:
                    case FieldNameEnum.TotalAssetLessCurrentLiability:
                    case FieldNameEnum.SharesOutstanding:

                    //Income Statement Fields
                    case FieldNameEnum.Revenue:
                    case FieldNameEnum.Sales:
                    case FieldNameEnum.FinancingRevenue:
                    case FieldNameEnum.AffiliateRevenue:
                    case FieldNameEnum.OtherRevenue:
                    case FieldNameEnum.InterestIncome:
                    case FieldNameEnum.NonInterestIncome:
                    case FieldNameEnum.PrincipleTransactions:
                    case FieldNameEnum.CommissionFee:
                    case FieldNameEnum.PremiumIncome:
                    case FieldNameEnum.NetInvestmentIncome:
                    case FieldNameEnum.NetInvestmentGain:
                    case FieldNameEnum.OtherIncome:
                    case FieldNameEnum.InterestExpense:
                    case FieldNameEnum.NetInterestBeforeProvision:
                    case FieldNameEnum.ProvisionForLoss:
                    case FieldNameEnum.NetInterestAfterProvision:
                    case FieldNameEnum.DirectExpense:
                    case FieldNameEnum.GrossProfit:
                    case FieldNameEnum.NonInterestExpense:
                    case FieldNameEnum.BenefitExpense:
                    case FieldNameEnum.BenefitClaim:
                    case FieldNameEnum.TotalOperatingExpense:
                    case FieldNameEnum.IndirectExpense:
                    case FieldNameEnum.SellingGeneralAdministrativeExpense:
                    case FieldNameEnum.DepreciationAmortization:
                    case FieldNameEnum.ResearchDevelopment:
                    case FieldNameEnum.RespectiveRightInterest:
                    case FieldNameEnum.OtherOperatingExpense:
                    case FieldNameEnum.OperatingIncome:
                    case FieldNameEnum.NonOperatingIncome:
                    case FieldNameEnum.NonOperatingNetInterestIncome:
                    case FieldNameEnum.NonOperatingForeignCurrencyGain:
                    case FieldNameEnum.NonOperatingGain:
                    case FieldNameEnum.OtherNonOperating:
                    case FieldNameEnum.MarketingAdvertising:
                    //case FieldNameEnum.DepreciationAmortization:
                    case FieldNameEnum.RestructImpairment:
                    case FieldNameEnum.NonInterestEmployeeCost:
                    case FieldNameEnum.Occupancy:
                    case FieldNameEnum.FurnitureEquipment:
                    case FieldNameEnum.OtherNonInterestExpense:
                    case FieldNameEnum.PolicyholderInterestDividend:
                    case FieldNameEnum.PolicyAmortizationCost:
                    case FieldNameEnum.SellingCommission:
                    case FieldNameEnum.GeneralAdministrativeExpense:
                    case FieldNameEnum.RestructuringDemutualization:
                    case FieldNameEnum.OtherInsuranceExpense:
                    case FieldNameEnum.EBTContinuing:
                    case FieldNameEnum.EBTContinuingCumulated:
                    case FieldNameEnum.Taxation:
                    case FieldNameEnum.TaxationCumulated:
                    case FieldNameEnum.CurrentTaxation:
                    case FieldNameEnum.DeferredTaxation:
                    case FieldNameEnum.EATContinuing:
                    case FieldNameEnum.MinorityInterst:
                    case FieldNameEnum.EquityEarning:
                    case FieldNameEnum.DiscountinuedOperation:
                    case FieldNameEnum.Extraord:
                    case FieldNameEnum.AccountChange:
                    case FieldNameEnum.NetIncome:
                    case FieldNameEnum.PreferedDividend:
                    case FieldNameEnum.NetIncometoCommon:
                    case FieldNameEnum.DividendPerShare:
                    case FieldNameEnum.PrimaryEPS:
                    case FieldNameEnum.DilutedEPS:
                    case FieldNameEnum.BasicContEPS:
                    case FieldNameEnum.DilutedContEPS:
                    case FieldNameEnum.PrimaryShares:
                    case FieldNameEnum.DilutedShares:
                    // Cash Flow Statement Fields
                    case FieldNameEnum.FreeCashFlow:
                    case FieldNameEnum.NetCapitalExpensePlus:
                    case FieldNameEnum.CapitalExpensePlus:
                    case FieldNameEnum.ChangeInCash:
                    case FieldNameEnum.ClosingCash:
                    case FieldNameEnum.OpeningCash:
                    case FieldNameEnum.OpeningCashCumulatedStart:
                    case FieldNameEnum.CashFromOperation:
                    case FieldNameEnum.CashFlowNetIncome:
                    case FieldNameEnum.CashFromSales:
                    case FieldNameEnum.CashToEmployeeSupplier:
                    case FieldNameEnum.OtherCash:
                    case FieldNameEnum.IncomeAdjustment:
                    case FieldNameEnum.WorkingCapitalChange:
                    case FieldNameEnum.OtherOperatingFlow:
                    case FieldNameEnum.CashFromInvesting:
                    case FieldNameEnum.NetCapitalExpense:
                    case FieldNameEnum.CapitalExpense:
                    case FieldNameEnum.PPEProceed:
                    case FieldNameEnum.ChangeInInvestment:
                    case FieldNameEnum.InvestmentPurchase:
                    case FieldNameEnum.InvestmentDisposal:
                    case FieldNameEnum.BusinessAcqusitionDisposal:
                    case FieldNameEnum.ChangeInFFSSP:
                    case FieldNameEnum.ChangeInLoanLease:
                    case FieldNameEnum.OtherInvestingFlow:
                    case FieldNameEnum.CashFromFinancing:
                    case FieldNameEnum.ChangeInEquity:
                    case FieldNameEnum.ChangeInDebt:
                    case FieldNameEnum.ShortTermDebtChange:
                    case FieldNameEnum.LongTermDebtChange:
                    case FieldNameEnum.PaymentOfDividend:
                    case FieldNameEnum.MergerRelatedExpense:
                    case FieldNameEnum.ChangeInDeposit:
                    case FieldNameEnum.PolicyholderDeposit:
                    case FieldNameEnum.PolicyholderWithdrawal:
                    case FieldNameEnum.OtherFinancingFlow:
                    case FieldNameEnum.EffectOfExchangeRate:
                    case FieldNameEnum.CashFromDiscountinuedOperation:
                        throw new ArgumentOutOfRangeException(fieldName.ToString() + " is not found in this statement");
                    default:
                        throw new ArgumentOutOfRangeException(fieldName.ToString() + " not a financial statement field");
                }
            }
        }

        /// <summary>
        /// A predefined list of fields of financial statements, read only
        /// </summary>
        private static List<FieldNameEnum> statementFieldList = new List<FieldNameEnum>(){
              FieldNameEnum.TotalAsset,
              FieldNameEnum.CurrentAsset,
              FieldNameEnum.CashEquivalentShortTermInvestment,
              FieldNameEnum.ShortTermInvestment,
              FieldNameEnum.Receivable,
              FieldNameEnum.ShortTermAssetRelatedParty,
              FieldNameEnum.CurrentTaxAsset,
              FieldNameEnum.ShortTermPrepayment,
              FieldNameEnum.ShortTermAssetForSale,
              FieldNameEnum.CurrentAssetDiscountinuedOperation,
              FieldNameEnum.Inventory,
              FieldNameEnum.RawMaterial,
              FieldNameEnum.WorkInProcess,
              FieldNameEnum.FinishedGoods,
              FieldNameEnum.Supplies,
              FieldNameEnum.OtherInventory,
              FieldNameEnum.OtherCurrentAsset,
              FieldNameEnum.LongTermAsset,
              FieldNameEnum.NetPropertyPlantEquipment,
              FieldNameEnum.GrossPropertyPlantEquipment,
              FieldNameEnum.AccumulatedDepreciation,
              FieldNameEnum.Land,
              FieldNameEnum.Building,
              FieldNameEnum.LongTermInvestment,
              FieldNameEnum.Intangible,
              FieldNameEnum.Goodwill,
              FieldNameEnum.IntangiblesExclueGoodWill,
              FieldNameEnum.LongTermPrepayment,
              FieldNameEnum.LongTermAssetRelatedParty,
              FieldNameEnum.LongTermAssetForSale,
              FieldNameEnum.LongTermReceivable,
              FieldNameEnum.DefferedLongTermAssetCharge,
              FieldNameEnum.NonCurrentAssetDiscountinuedOperation,
              FieldNameEnum.NetLoanLease,
              FieldNameEnum.Investment,
              FieldNameEnum.OtherLongTermAsset,
              FieldNameEnum.FedFundResell,
              FieldNameEnum.AssetDiscountinuedOperation,
              FieldNameEnum.LoansForSale,
              FieldNameEnum.LoanPortfolio,
              FieldNameEnum.LoanProvisions,
              FieldNameEnum.DeferredPolicyAcqusitionCost,
              FieldNameEnum.OtherAsset,
              FieldNameEnum.Prepayment,
              FieldNameEnum.TotalAssetRelatedParty,
              FieldNameEnum.InsuranceReceivable,
              FieldNameEnum.AssetForSale,
              FieldNameEnum.Securities,
              FieldNameEnum.CustomerAcceptanceLiability,
              FieldNameEnum.TotalLiability,
              FieldNameEnum.CurrentLiability,
              FieldNameEnum.AccountPayableAccruedExpense,
              FieldNameEnum.AccountPayable,
              FieldNameEnum.AccuredExpense,
              FieldNameEnum.CurrentDebtCapitalLease,
              FieldNameEnum.CurrentDebt,
              FieldNameEnum.CurrentCapitalLeaseObligation,
              FieldNameEnum.ShortTermLiabilityRelatedParties,
              FieldNameEnum.CurrentLiabilityDiscountinuedOperation,
              FieldNameEnum.OtherCurrentLiability,
              FieldNameEnum.LongTermLiability,
              FieldNameEnum.LongTermObligations,
              FieldNameEnum.DeferredLongTermLiabilityCharge,
              FieldNameEnum.NonCurrentLiabilityDiscountinuedOperation,
              FieldNameEnum.PensionsOPEB,
              FieldNameEnum.CustomerAdvanceDeposit,
              FieldNameEnum.TotalDeposits,
              FieldNameEnum.OtherLongTermLiability,
              FieldNameEnum.TemporaryEquity,
              FieldNameEnum.BalanceSheetMinority,
              FieldNameEnum.ShareMandatoryRedemption,
              FieldNameEnum.TotalLiabilityEquity,
              FieldNameEnum.FedFundRepurchase,
              FieldNameEnum.LiabilityDiscountinuedOperation,
              FieldNameEnum.DepositInterestBearing,
              FieldNameEnum.DepositNonInterestBearing,
              FieldNameEnum.CurrentPortionLongTermDebt,
              FieldNameEnum.PolicyLiability,
              FieldNameEnum.OtherLiability,
              FieldNameEnum.LongTermLiabilityRelatedParty,
              FieldNameEnum.TotalLiabilityRelatedParty,
              FieldNameEnum.DebtLeaseOligation,
              FieldNameEnum.CapitalLeaseObligation,
              FieldNameEnum.InsurancePayable,
              FieldNameEnum.BankReceivable,
              FieldNameEnum.ShareholdersEquity,
              FieldNameEnum.CommonShareCapital,
              FieldNameEnum.PreferredShareCapital,
              FieldNameEnum.ShorePremium,
              FieldNameEnum.RetainedEarning,
              FieldNameEnum.AccumulatedOtherIncome,
              FieldNameEnum.OtherEquity,
              FieldNameEnum.TreasuryStock,
              FieldNameEnum.ForeignCurrencyTransation,
              FieldNameEnum.NetAssets,
              FieldNameEnum.NetCurrentAssets,
              FieldNameEnum.TotalAssetLessCurrentLiability,
              FieldNameEnum.SharesOutstanding,
            //              <!--  Income Statement -->
              FieldNameEnum.Revenue,
              FieldNameEnum.Sales,
              FieldNameEnum.FinancingRevenue,
              FieldNameEnum.AffiliateRevenue,
              FieldNameEnum.OtherRevenue,
              FieldNameEnum.InterestIncome,
              FieldNameEnum.NonInterestIncome,
              FieldNameEnum.PrincipleTransactions,
              FieldNameEnum.CommissionFee,
              FieldNameEnum.PremiumIncome,
              FieldNameEnum.NetInvestmentIncome,
              FieldNameEnum.NetInvestmentGain,
              FieldNameEnum.OtherIncome,
              FieldNameEnum.InterestExpense,
              FieldNameEnum.NetInterestBeforeProvision,
              FieldNameEnum.ProvisionForLoss,
              FieldNameEnum.NetInterestAfterProvision,
              FieldNameEnum.DirectExpense,
              FieldNameEnum.GrossProfit,
              FieldNameEnum.NonInterestExpense,
              FieldNameEnum.BenefitExpense,
              FieldNameEnum.BenefitClaim,
              FieldNameEnum.TotalOperatingExpense,
              FieldNameEnum.IndirectExpense,
              FieldNameEnum.SellingGeneralAdministrativeExpense,
              FieldNameEnum.DepreciationAmortization,
              FieldNameEnum.ResearchDevelopment,
              FieldNameEnum.RespectiveRightInterest,
              FieldNameEnum.OtherOperatingExpense,
              FieldNameEnum.OperatingIncome,
              FieldNameEnum.NonOperatingIncome,
              FieldNameEnum.NonOperatingNetInterestIncome,
              FieldNameEnum.NonOperatingForeignCurrencyGain,
              FieldNameEnum.NonOperatingGain,
              FieldNameEnum.OtherNonOperating,
              FieldNameEnum.MarketingAdvertising,
              //FieldNameEnum.DepreciationAmortization,
              FieldNameEnum.RestructImpairment,
              FieldNameEnum.NonInterestEmployeeCost,
              FieldNameEnum.Occupancy,
              FieldNameEnum.FurnitureEquipment,
              FieldNameEnum.OtherNonInterestExpense,
              FieldNameEnum.PolicyholderInterestDividend,
              FieldNameEnum.PolicyAmortizationCost,
              FieldNameEnum.SellingCommission,
              FieldNameEnum.GeneralAdministrativeExpense,
              FieldNameEnum.RestructuringDemutualization,
              FieldNameEnum.OtherInsuranceExpense,
              FieldNameEnum.EBTContinuing,
              FieldNameEnum.EBTContinuingCumulated,
              FieldNameEnum.Taxation,
              FieldNameEnum.TaxationCumulated,
              FieldNameEnum.CurrentTaxation,
              FieldNameEnum.DeferredTaxation,
              FieldNameEnum.EATContinuing,
              FieldNameEnum.MinorityInterst,
              FieldNameEnum.EquityEarning,
              FieldNameEnum.DiscountinuedOperation,
              FieldNameEnum.Extraord,
              FieldNameEnum.AccountChange,
              FieldNameEnum.NetIncome,
              FieldNameEnum.PreferedDividend,
              FieldNameEnum.NetIncometoCommon,
              FieldNameEnum.DividendPerShare,
              FieldNameEnum.PrimaryEPS,
              FieldNameEnum.DilutedEPS,
              FieldNameEnum.BasicContEPS,
              FieldNameEnum.DilutedContEPS,
              FieldNameEnum.PrimaryShares,
              FieldNameEnum.DilutedShares,
            // <!-- Cash Flow Statement -->
              FieldNameEnum.FreeCashFlow,
              FieldNameEnum.NetCapitalExpensePlus,
              FieldNameEnum.CapitalExpensePlus,
              FieldNameEnum.ChangeInCash,
              FieldNameEnum.ClosingCash,
              FieldNameEnum.OpeningCash,
              FieldNameEnum.OpeningCashCumulatedStart,
              FieldNameEnum.CashFromOperation,
              FieldNameEnum.CashFlowNetIncome,
              FieldNameEnum.CashFromSales,
              FieldNameEnum.CashToEmployeeSupplier,
              FieldNameEnum.OtherCash,
              FieldNameEnum.IncomeAdjustment,
              FieldNameEnum.WorkingCapitalChange,
              FieldNameEnum.OtherOperatingFlow,
              FieldNameEnum.CashFromInvesting,
              FieldNameEnum.NetCapitalExpense,
              FieldNameEnum.CapitalExpense,
              FieldNameEnum.PPEProceed,
              FieldNameEnum.ChangeInInvestment,
              FieldNameEnum.InvestmentPurchase,
              FieldNameEnum.InvestmentDisposal,
              FieldNameEnum.BusinessAcqusitionDisposal,
              FieldNameEnum.ChangeInFFSSP,
              FieldNameEnum.ChangeInLoanLease,
              FieldNameEnum.OtherInvestingFlow,
              FieldNameEnum.CashFromFinancing,
              FieldNameEnum.ChangeInEquity,
              FieldNameEnum.ChangeInDebt,
              FieldNameEnum.ShortTermDebtChange,
              FieldNameEnum.LongTermDebtChange,
              FieldNameEnum.PaymentOfDividend,
              FieldNameEnum.MergerRelatedExpense,
              FieldNameEnum.ChangeInDeposit,
              FieldNameEnum.PolicyholderDeposit,
              FieldNameEnum.PolicyholderWithdrawal,
              FieldNameEnum.OtherFinancingFlow,
              FieldNameEnum.EffectOfExchangeRate,
              FieldNameEnum.CashFromDiscountinuedOperation,
            // <!--  Ratios -->
              FieldNameEnum.MarketCapital,
              FieldNameEnum.PriceEarningRatio,
              FieldNameEnum.PriceSalesRatio,
              FieldNameEnum.EmployeeNumber,
              FieldNameEnum.GrossMargin,
              FieldNameEnum.OperatingMargin,
              FieldNameEnum.PretaxMargin,
              FieldNameEnum.NetMargin,
              FieldNameEnum.QuickRatio,
              FieldNameEnum.CurrentRatio,
              FieldNameEnum.TotalDebtToEquity,
              FieldNameEnum.InterestCoverage,
              FieldNameEnum.AverageDividendYield,
              FieldNameEnum.DividendPayOutPercent,

              FieldNameEnum.ReturnOnInvestment,
              FieldNameEnum.ReturnOnEquity,
              FieldNameEnum.RevenuePerEmployee,
              FieldNameEnum.NetIncomePerEmployee,
              FieldNameEnum.ReceivableTurnover,
              FieldNameEnum.InventoryTurnover,
              FieldNameEnum.AssetTurnover

        };
        
        public static List<FieldNameEnum> StatementFieldList
        {
            get { return Statement.statementFieldList; }
        }
    }   


    public enum StatementPeriodType
    {
        Q1, Q2, Q3, Q4, A
    }
}
